<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8"%>
<%@ include file="header_teacher.jsp"%>
<!-- 以上为页头 设置head 引用样式相关信息 请勿修改  请直接修改header.jsp文件  by 小灯笼 -->

<link rel="stylesheet" type="text/css" href="css/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.theme.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){
	
	//初始化
	$("#PDate").datepicker();
	$("#PDate").datepicker( "option", "dateFormat", "yy-mm-dd" );
	//教材编号为数值型参数
	$("#bookId").keyup(function(){
		if(isNaN($("#bookId").val()))
		{
			$("#book_error").show();
			$("#submit_btn").attr("disabled","true");  //提交按钮无效
		}
			
		else
		{
			$("#book_error").hide();
			$("#submit_btn").removeAttr("disabled");  //提交按钮有效			
		}
			
	});
	
	
});
</script>
<script>

$(document).ready(function(){
	$("#add").click(function(){
		$("#submit")
		.before("<div class='control-group'>"+
        	        "<label class='control-label' for='author'>"+
      		   	        "作者"+
    		        "</label>"+
    		        "<div class='controls'>"+
    		           "<input type='text' name='author' id='author' class='span6' placeholder='作者/名次' required>"+
    		        "</div>"+
  			   "</div>");
	});
});
</script>
<!-- 以下为正文 -->


<link rel="stylesheet" type="text/css" href="css/jquery-ui.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/jquery-ui.min.js"></script>

<div class="left-sidebar">
            <div class="row-fluid">
              <div class="span12">
                <div class="widget">
                  <div class="widget-header">
                    <div class="title">
                      	6.出版教材
                      <span class="mini-title">
                        	6
                      </span>
                    </div>
                    <span class="tools">
                      <a class="fs1" aria-hidden="true" data-icon="" data-original-title=""></a>
                    </span>
                  </div>
                  <div class="widget-body">
                    
                    <form class="form-horizontal no-margin" action="submit_book" method="post">
                       <div class="control-group">
                        <label class="control-label" for="bookId" >
                          	教材编号
                        </label>
                        <div class="controls controls-row">
                          <input class="span3" type="text" id="bookId" name="bookId" placeholder="教材编号" required>
                          <span id="book_error" class="badge badge-important" style="display:none">
                      			教材编号应当为数字
                    	  </span>                          
                        </div>
                      </div>
                      <div class="control-group">
                        <label class="control-label" for="bookName" >
                          	教材名称
                        </label>
                        <div class="controls controls-row">
                          <input class="span3" type="text" id="bookName" name="bookName" placeholder="名称" required>
                        </div>
                      </div>
                      <div class="control-group">
                        <label class="control-label" for="PDate">
                          	出版时间
                        </label>
                        <div class="controls">
                          <input type="text" name="PDate" id="PDate" class="span3" placeholder="出版时间" required>
                        </div>
                      </div>
                  
                      <div class="control-group">
                        <label class="control-label" for="PDep">
                          	出版单位
                        </label>
                        <div class="controls">
                          <input type="text" name="PDep" id="PDep" class="span6" placeholder="出版单位" required>
                        </div>
                      </div>
                      
		               <div class="control-group">
			               <div class="controls">
			               		<button id="add" class="btn btn-primary bottom-margin" type="button">
			               		<span class="fs1" aria-hidden="true" data-icon="&#xe102;"></span> 添加作者</button>
			               </div>
		               </div>
		               
		               
                      <div class="author">
	                      <div class="control-group">
	                        <label class="control-label" for="author">
	                          	作者
	                        </label>
	                        <div class="controls">
	                          <input type="text" name="author" id="author" class="span6" placeholder="作者/名次" required>
	                        </div>
	                      </div>
                      </div>
                      
                      <div class="form-actions no-margin" id="submit">
                        <button id="submit_btn" type="submit" class="btn btn-info pull-right">
                          	发布
                        </button>
                        <div class="clearfix">
                        </div>
                      </div>
                      
                    </form>
                    
                  </div>
                </div>
              </div>
            </div>
          </div>

<!-- 以上为正文 -->

<!-- 以下为页脚 及JS相关 请勿修改 请直接修改footer.jsp文件   by 小灯笼 -->
<jsp:include page="footer.jsp" />